package priv.pront.code.robot.roboCom_pri_2021.zhi.fu;

import java.io.*;
import java.util.HashSet;
import java.util.Set;

/**
 * @Description:
 * @Author: pront
 * @Time:2023-07-11 18:51
 */
public class 人工智能打招呼 {
    static BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter out = new PrintWriter(System.out);
    static Set<String> set = new HashSet<>();

    public static void main(String[] args) throws IOException {
        int n = Integer.parseInt(bf.readLine());
        String[] s = bf.readLine().split(" ");
        for (int i = 0; i < n; i++) {
            if(!set.contains(s[i])){
                out.println("Hello " + s[i] + ", " + "how are you?");
                out.flush();
                set.add(s[i]);
            }else{
                out.println("Hi " + s[i] + "! " + "Glad tp see you again!");
                out.flush();
            }
        }
    }
}
